Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rename_all to FromRow, add camelCase and PascalCase to all rename_all #860

Merged
merged 7 commits into from
Dec 19, 2020

Conversation

framp
Copy link
Contributor

@framp framp commented Nov 28, 2020

As per title.

Sample usage (from test)

#[derive(Debug, sqlx::FromRow)]
#[sqlx(rename_all = "camelCase")]
struct AccountKeyword {
    user_id: i32,
    user_name: String,
    user_surname: String,
}

It looks like this feature was present in a previous version / someone's intention because it was already documented (but not working).

The choice of using camelCase and PascalCase was taken for consistency with serde and with the existing documentation, even though heck's terminology is mixedCase and CamelCase

@framp framp changed the title Add rename_all to FromRow, add mixedCase and CamelCase to all rename_all Add rename_all to FromRow, add camelCase and PascalCase to all rename_all Nov 28, 2020
@mehcode
Copy link
Member

mehcode commented Dec 19, 2020

It looks like this feature was present in a previous version

It's present for the Type derive. The docs must be incorrect.


Really appreciate this addition. Good job. 🙌

@mehcode mehcode merged commit c416c94 into launchbadge:master Dec 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants